//package com.ruoyi.web.controller.studentClass;
//
//import com.ruoyi.classes.domain.Classes;
//import com.ruoyi.classes.service.IClassesService;
//import com.ruoyi.system.service.IUsersService;
////import com.ruoyi.userss.service.StudentClassService;
//import com.ruoyi.web.controller.common.R;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * @Classname StudentClassController
// * @Description
// * @Date 2025/5/23 15:36
// * @Created by 高合吴彦祖鹏哥
// */
//@RestController
//@RequestMapping("/studentClass")
//public class StudentClassController {
//    @Autowired
//    private StudentClassService studentClassService;
//    @Autowired
//    private IClassesService classesService;
//    @Autowired
//    private IUsersService usersService;
//
////    查询该学生的课程
//    @GetMapping("/{id}")
//    public R selectStudentAndClasses(@PathVariable Long id){
//        List<Classes> classes = studentClassService.selectStudentWithClasses(id);
//        return R.success(classes);
//    }
//
////    学生选课
////    @PostMapping("/chooseClasses")
////    public R chooseClasses(@RequestBody StudentClass studentClass) {
////        Long studentId = studentClass.getStudentId();
////        Long classId = studentClass.getClassId();
////        Users users = usersService.selectUsersById(studentId);
////        Classes classes = classesService.selectClassesById(classId);
////        StudentClass studentClass2 = studentClassService.selectByStudentId(classId, studentId);
////
////
////        StudentClass studentClass1 = new StudentClass();
////        if (classes.getRegistrationTime().isBefore(LocalDateTime.now()) || classes.getDeadTime().isAfter(LocalDateTime.now())) {
////            return R.error("课程未开设");
////        }else if(classes.getStartTime().isAfter(LocalDateTime.now())||classes.getEndTime().isBefore(LocalDateTime.now())){
////            return R.error("课程已结束");
////        }else if(studentClass2!=null){
////            return R.error("已选该课程");
////        }else{
////            studentClass1.setClassId(classId);
////            studentClass1.setStudentId(studentId);
////            studentClass1.setClassesName(classes.getName());
////            studentClass1.setStudentName(users.getNickName());
////            studentClass1.setStudentPhone(users.getPhone());
////            studentClass1.setEndTime(classes.getEndTime());
////            studentClass1.setStartTime(classes.getStartTime());
////        }
////        return R.success(studentClassService.insertStudentClasses(studentClass1));
////    }
//
//}